package arraysOperations;
import array.SortArrays;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.annotations.Parameters;



public class HomeTest1 {

    // here we include:
    // - 1 array for sorting;
    // - 2 array for comparing the result with sorted array
    @DataProvider
    public Object[][] testStrings()
    {
        return new Object[][] {
                new Object[] {new String [] {"a","y","o"},new String [] {"a","o","y"} },
                new Object[] {new String [] {"a","2","o","5","y","1"},new String [] {"1","2","5","a","o","y"}, },
                new Object[] {new String [] {"a","2","o","5","y","1"},new String [] {"1","2","5","a","o","y"}, },
        };
    }

    @Test(dataProvider = "testStrings")
    public void testingTest2(String[] incomeString, String[] sortedString ) {
        // here we sort a first array got from DataProvider
        SortArrays.sortArray(incomeString);
        // here we compare results
        Assert.assertEquals(incomeString,sortedString);

    }
}
